<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style.css" type="text/css" />
<title>Documento senza titolo</title>
</head>

<body>
<div id="header">
	<div class="header"></div>
</div>

<div id="menu">
<div class="menu"><a href="javascript:window.close();">Chiudi</a></div>
<div class="menu"></div>
<div class="menu"></div>
<div class="menu"></div>
<div class="menu"></div>
</div>

<div id="body"><!--div class="submenu"><a href="#">Sub Menu1</a> / <a href="#">Sub Menu2</a> / <a href="#">Sub Menu3</a></div-->
<div class="spacer"></div>
<div class="content">
<table width="100%" border="0" align="center">
<c:forEach items="${storicoTickets}" var="item" varStatus="counter">
	<c:if test="${counter.index==0 }">
		
		<tr>
			<td width="30%">Progetto</td>
			<td  width="70%" colspan="5"><c:out value="${descrizioneProgetto }"/> </td>
		</tr>
		<tr>
			<td width="30%">Titolo</td>
			<td  width="70%" colspan="5"><c:out value="${item.tickets.titoloTicket }"/> </td>
		</tr>
		<tr>
			<td>Stato</td>
			<td colspan="5"><c:out value="${item.tickets.stati.descrizione }"/></td>
		</tr>
		<tr>
			<td>Data inserimento</td>
			<td colspan="5"><fmt:formatDate value="${item.tickets.dataInserimento }" pattern="dd/MM/yyyy HH:mm"/></td>
		</tr>
		<tr>
			<td>Data ultima modifica</td>
			<td colspan="5"><fmt:formatDate value="${item.tickets.dataUltimaModifica }" pattern="dd/MM/yyyy HH:mm"/></td>
		</tr>
		<tr>
			<td colspan="6">&nbsp;</td>
		</tr>
		<tr>
			<th>Data Modifica</th>
			<th>Ora Modifica</th>
			<th>Descrizione</th>
			<th>Modificato da</th>
			<th>Ore previste</th>
			<th>Ore consuntivo</th>
		</tr>
	</c:if>

		<c:choose>
			<c:when test="${item.prossimaAzione==null }">
				<tr>
					<td width="10%"><fmt:formatDate value="${item.dataModifica }"
						pattern="dd/MM/yyyy" /></td>
					<td width="10%"><fmt:formatDate value="${item.dataModifica }"
						pattern="HH:mm" /></td>
					<td width="30%"><c:out value="${item.descrizione}"></c:out></td>
					<td width="20%"><c:out
						value="${item.tickets.utentiByIdUtenteUltimaModifica.cognome}"></c:out></td>
					<td width="10%"><c:out
						value="${item.orePreviste}"></c:out></td>
					<td width="20%"><c:out
						value="${item.oreConsuntivo}"></c:out></td>
				</tr>
			</c:when>
			<c:otherwise>
				<tr>
					<td width="10%"><fmt:formatDate value="${item.dataModifica }"
						pattern="dd/MM/yyyy" /></td>
					<td width="10%"><fmt:formatDate value="${item.dataModifica }"
						pattern="HH:mm" /></td>
					<td width="30%"><c:out value="${item.prossimaAzione}"></c:out></td>
					<td width="20%"><c:out
						value="${item.tickets.utentiByIdUtenteUltimaModifica.cognome}"></c:out></td>
					<td width="10%"><c:out
						value="${item.orePreviste}"></c:out></td>
					<td width="20%"><c:out
						value="${item.oreConsuntivo}"></c:out></td>
				</tr>
			</c:otherwise>
		</c:choose>
		<c:if test="${counter.index==fn:length(storicoTickets)-1 }">
				<tr>
					<td colspan="4" width="70%">Totale: </td>
					<td width="10%"><c:out
						value="${orePreviste}"></c:out></td>
					<td width="20%"><c:out
						value="${oreConsuntivo}"></c:out></td>
				</tr>
		</c:if>
	</c:forEach>
</table>
</div>
</div>

</body>
</html>